package com.action.front;


import java.util.List;

import com.entity.journal.Journal;
import com.entity.journal.JournalCategory;
import com.entity.journal.JournalComment;
import com.entity.journal.JournalVisitor;
import com.opensymphony.xwork2.ActionSupport;
import com.service.journal.JournalService;

/**
 * 
 * @author Chenql
 * date 2012-05-23
 * 个人模块--日志Action
 */
public class JournalAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5304345855170240058L;
	
	private List<Journal> journalList;
	
	private List<JournalComment> journalCommentList;
	
	private List<JournalVisitor> journalVisitorList;
	
	private JournalCategory journalCategory;
	
	private Integer userId;
	
	private Integer journalId;
	
	private JournalService journalService;
	
	public String toJournalList()
	{
		try {
			journalList = journalService.getJournalList(userId);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "toJournalList";
	}
	
	public String  toCommentList()
	{
		try {
			journalCommentList = journalService.getCommentList(journalId);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "toCommentList";
	}
	
	public String getVisitorList()
	{
		try {
			journalVisitorList = journalService.getVisitorList(journalId);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "getVisitorList";
	}

	public String saveCategory()
	{
		try {
			journalService.saveCategory(journalCategory);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "saveCategory";
	}

	public JournalCategory getJournalCategory() {
		return journalCategory;
	}

	public void setJournalCategory(JournalCategory journalCategory) {
		this.journalCategory = journalCategory;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public Integer getJournalId() {
		return journalId;
	}

	public void setJournalId(Integer journalId) {
		this.journalId = journalId;
	}

	public JournalService getJournalService() {
		return journalService;
	}

	public void setJournalService(JournalService journalService) {
		this.journalService = journalService;
	}

	public List<Journal> getJournalList()
	{
		return journalList;
	}
	
	public void setJournalList(List<Journal> journalList) {
		this.journalList = journalList;
	}

	public List<JournalComment> getJournalCommentList()
	{
		return journalCommentList;
	}
	
	public void setJournalCommentList(List<JournalComment> journalCommentList) {
		this.journalCommentList = journalCommentList;
	}
	
	public List<JournalVisitor> getJournalVisitorList()
	{
		return journalVisitorList;
	}

	public void setJournalVisitorList(List<JournalVisitor> journalVisitorList) {
		this.journalVisitorList = journalVisitorList;
	}
	
}
